$(document).ready(function () {
    $("#email").val(sessionStorage.getItem("userEmail"));
    $("#firstName").val(sessionStorage.getItem("firstName"));
    $("#lastName").val(sessionStorage.getItem("lastName"));
    $("#BloodType").val("BloodType");
    $("#city").val("City");
})

function updateUser() {
    let firstName = document.getElementById("firstName").value;
    let lastName = document.getElementById("lastName").value;
    let bloodType = document.getElementById("BloodType").value;
    //document.getElementById("bloodType").value
    let cityName  = document.getElementById("city").value;

    //console.log(SERVER_URL+"/user/"+sessionStorage.getItem("userEmail")+"?Password&firstName="+firstName+"&lastName="+lastName+"&cityName="+cityName+"&bloodType="+bloodType)
    $.ajax({
        type: "put",
        url: SERVER_URL+"/user/"+sessionStorage.getItem("userEmail")+"?Password&firstName="+firstName+"&lastName="+lastName+"&cityName="+cityName+"&bloodType="+bloodType,
        async: true,
        dataType: "json",
        success: function (data) {
            window.location.href="PInfo.html";
        }
    });
}

